Passed
Pull Request — master (#134)
by
unknown
02:20
created

Token   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 36
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 8

8 Functions

Rating   Name   Duplication   Size   Complexity  
A isAccessTokenValid 0 1 1
A isRefreshTokenValid 0 1 1
A refreshToken 0 1 1
A setToken 0 9 1
A getToken 0 1 1
A accessToken 0 1 1
A clearToken 0 1 1
A tokenType 0 1 1
1
2
export class Token {
3
  realmId:                    string;
4
  token_type:                 string;
5
  access_token:               string;
6
  refresh_token:              string;
7
  expires_in:                 number;
8
  x_refresh_token_expires_in: number;
9
  id_token:                   string;
10
  latency:                    number;
11
  createdAt:                  number;
12
  constructor(opts?: {
13
    realmId: string,
14
    token_type: string,
15
    access_token: string,
16
    refresh_token: string,
17
    expires_in: number,
18
    x_refresh_token_expires_in: number,
19
    id_token: string,
20
    latency: number,
21
    createdAt: number
22
  });
23
  isAccessTokenValid(): boolean;
24
  isRefreshTokenValid(): boolean;
25
  accessToken(): string;
26
  refreshToken(): string;
27
  tokenType(): string;
28
  getToken(): Token;
29
  setToken(opts: {
30
    access_token: string;
31
    refresh_token: string;
32
    token_type: string;
33
    expires_in: number;
34
    x_refresh_token_expires_in: number;
35
    id_token?: string;
36
    createdAt?: number
37
  }): this;
38
  clearToken(): this;
39
}
40